<template>
  <div class="info-item-box" :class="size">
    <div class="label" v-if="label">{{label}}：</div>
    <div class="value" @click="onClick">
      <span :style="slotstyle">{{value === 0 ? value : (value || '-')}}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'InfoItem',
  data () {
    return {}
  },
  props: {
    label: {
      type: String,
      default: ''
    },
    value: {
      default: ''
    },
    size: {
      type: String,
      default: 'default'
    },
    slotstyle: {
      type: String,
      default: ''
    }
  },
  computed: {},
  created () {},
  mounted () {},
  watch: {},
  methods: {
    onClick (e) {
      this.$emit('click', e)
    }
  }
}
</script>

<style scoped lang='less'>
.info-item-box {
  display: flex;
  width: 50%;
  padding: 3px 0;
  line-height: 22px;
  &.large {
    width: 100%;
  }
  .label {
    min-width: 70px;
    flex-shrink: 0;
    color: #999;
    font-size: 13px;
  }
  .value {
    color: #555;
    font-size: 13px;
  }
}
</style>
